﻿using System;
using Server.Net;
using Server.Tools;
using Server.Dao;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Reflection.Emit;

namespace Server
{
    /// <summary>
    /// 应用程序入口类
    /// </summary>
    class Program
    {
        /// <summary>
        /// 应用程序入口
        /// </summary>
        /// <param name="args">执行参数</param>
        static void Main(string[] args)
        {
            try
            {
                Properties.Settings.Default.Reset();

                if ((new DBConnection()).CheckDBConnection() == true)
                {
                    LogService.Instance.Log.Info("连接数据库成功");
                    NetService netService = new NetService();

                    netService.StartService();
                    LogService.Instance.Log.Info("服务已开启");
                }
                else
                {
                    LogService.Instance.Log.Warn("连接数据库失败！");
                }

               

                while (true)
                {
                    String commentLine = Console.ReadLine();
                }
            }
            catch (Exception e)
            {
                LogService.Instance.Log.Error(e.ToString());
            }
            Console.Read();
        }
    }
}
